#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2015-2019, Intel Corporation

#
# src/test/pmem_memset/TEST0 -- unit test for pmem_memset
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type pmem non-pmem

setup

function test() {
	rm -f $DIR/testfile1
	truncate -s 4M $DIR/testfile1
	expect_normal_exit ./pmem_memset$EXESUFFIX $DIR/testfile1 $@
}

function test_all() {
	test 0 8
	test 13 4096
}

test_all

export PMEM_AVX512F=1

test_all

export PMEM_AVX=1

test_all

export PMEM_NO_MOVNT=1

test_all

export PMEM_NO_GENERIC_MEMCPY=1

test_all

pass
